package com.joysuch.wwyt.attendant.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joysuch.wwyt.attendant.bean.AttendantPlanDetailBean;
import com.joysuch.wwyt.attendant.bean.AttendantPlanReqBean;
import com.joysuch.wwyt.attendant.bean.vo.AttendantStatisticsAreaVo;
import com.joysuch.wwyt.attendant.bean.vo.AttendantStatisticsUserVo;
import com.joysuch.wwyt.attendant.entity.AttendantPlan;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author xsx
 * @version 1.0
 * @date 2023/2/15 11:39
 */
public interface AttendantPlanMapper extends BaseMapper<AttendantPlan> {

    Page<AttendantPlanDetailBean> selectPlanPage(Page<AttendantPlanDetailBean> page,@Param("search") AttendantPlanReqBean search);

    Long selectPlanCount(@Param("search") AttendantPlanReqBean search);

    long countByStatus(@Param("state")Integer state);

    Page<AttendantStatisticsUserVo> findStatisticsUserPage(@Param("page")Page<AttendantStatisticsUserVo> page, @Param("userIds")List<Long> userIds,@Param("jobId") Long jobId,
                                                           @Param("way")Integer way, @Param("startTime")Date startTime,
                                                           @Param("endTime")Date endTime, @Param("orgCode")String companyCode, @Param("tenentId")Long tenantId);

    Page<AttendantStatisticsAreaVo> findStatisticsAreaPage(@Param("page")Page<AttendantStatisticsAreaVo> page, @Param("areaIds")List<Long> areaIds, @Param("way")Integer way, @Param("startTime")Date startTime,
                                                           @Param("endTime")Date endTime, @Param("orgCode")String companyCode, @Param("tenentId")Long tenantId);

    List<AttendantPlan> selectByTime(@Param("date")Date date,@Param("state") Integer state,@Param("way") Integer way);

    void deletePlan();

    List<AttendantPlanDetailBean> selectByIds (@Param("ids") List<Long> ids);

    Long selectByAreaId(@Param("areaId") Long areaId);
}
